<template>
  <!-- <div class="patient-info" v-if="true">
    <div class="patient-info-inside">
      <div class="header">
        <div class="left item">
          <img alt="左侧" src="@/components/assets/images/design/1-12.webp" />
        </div>
        <div class="middle item">请选择发卡对象</div>
        <div class="right item">
          <img alt="右侧" src="@/components/assets/images/design/1-12.webp" />
        </div>
      </div>
      <div class="patient-info-area">
        <div
          v-for="(item, index) in list"
          :key="index"
          class="item"
          @click="postUserMsg(item)"
        >
          <div class="imgBox">
            <img
              alt="右侧"
              src="@/components/assets/images/design/1-50x1.png"
            />
          </div>
          <div class="connect">{{ item.name }}</div>
        </div>
      </div>
    </div>
  </div> -->
  <div class="appts-reg" data-info="费用查询">
    <el-row :gutter="28">
      <template v-for="item in apptsRegOptions">
        <el-col class="biz-item" :span="item.span">
          <div
              class="biz-item-inside"
              :class="item.className"
              @click="handleToBizs(item)"
          >
            <div class="info-wrap">
              <p class="icon"></p>
              <p class="name">{{ item.name }}</p>
            </div>
          </div>
        </el-col>
      </template>
    </el-row>
  </div>
</template>

<script>
import PatientNumberOperate from '@sc/DRCbiz/comps/patientNumberOperate'
import { v4 as uuid } from "uuid";
import { AndroidToWeb, buildParentApi } from "@/utils/designer/util";
let buildParent = buildParentApi();
export default {
  name: "CostInquiryPlatform",

  componentName: "CostInquiryPlatform",

  components: {
    PatientNumberOperate
  },

  data() {
    return {
      // list: [
      //   { name: "药品信息查询", value: "1" },
      //   { name: "项目信息查询", value: "2" },
      //   { name: "已缴费明细查询", value: "3" },
      //   { name: "住院一日清单查询", value: "4" },
      // ],
      backcountdown: 120000,
      apptsRegOptions: [
        {
          id: 1,
          span: 12,
          className: 'reservation-info',
          name: '药品信息查询',
          routeName:'Drug-information-inquiry',
          enName:'self-service reservation',
          descInfo:'药品信息查询'
        },
        {
          id: 2,
          span: 12,
          className: 'register-register',
          name: '项目信息查询',
          routeName:'Query-project-information',
          enName:'self-service register',
          descInfo:'项目信息查询'
        },
        // {
        //   id: 3,
        //   span: 12,
        //   className: 'takeNumber-info',
        //   name: '已缴费明细查询',
        //   routeName:'queryPaidDetails',
        //   enName:'self-service takeNumber',
        //   descInfo:'已缴费明细查询'
        // },
        {
          id: 4,
          span: 12,
          className: 'Recharge-recharge-hospital',
          name: '住院一日清单查询',
          routeName:'OneDayHospitalizationListQuery',
          enName:'self-service takeNumber',
          descInfo:'住院一日清单查询'
        },
      ]
    };
  },

  computed: {
    patientInfo() {
      return this.$store.getters["DRCbiz/getPatientInfo"];
    },
  },

  mounted() {
     const self = this;
    clearInterval(self.timer);
    self.backcountdown = 120000;
    self.timer = setInterval(() => {
      self.backcountdown = (self.backcountdown - 1000);
      // 到达时间--返回首页-清空定时器
      if ((self.backcountdown) <= 0) {
        clearInterval(self.timer);
        self.handleHome();
      }
    }, 1000)
  },

  methods: {
     /*预约-挂号-取号*/
    handleToBizs(row = Object()){
      let routeName = row?.routeName;
      this.$router.push({
        path: `/${routeName}/${row.id}`
        //  path: `/ReplenishmentMode/${row.id}`
      });
    },
     handleHome(){
      this.$router.push({
        path: `/DRCbizList`
      });
    },
    postUserMsg(row) {
      // this.$emit("postUserMsg", row);
      let devInfo = JSON.parse(localStorage.getItem("deviceInfo"));
      switch (row.value) {
        case "1": // QueryMedicinesInfo  药品信息查询
          
          break;
        case "2": // QueryCostInfo  项目信息查询
          
          break;
        case "3": // QueryFeeDetailRecord  已缴费明细查询
          this.$router.push({
            path: `/queryPaidDetails`,
          });
          break;
        case "4": //  ZYQueryBillDetail     住院一日清单查询
        this.$router.push({
            path: `/OneDayHospitalizationListQuery`,
          });
          
          break;
      }
    },
  },
};
</script>

<style scoped lang="scss">
@import "./assets/style";
</style>